home *** CD-ROM | disk | FTP | other *** search
/ Isometric Game Programming with DirectX 7.0 / Isometric Game Programming.iso / directx / dxf / extras / direct3d / tools / 3dsmax3 / meshdata.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-22  |  2.4 KB  |  100 lines

  1. //-----------------------------------------------------------------------------
  2. // File: MeshData.h
  3. //
  4. // Desc: Structures to store a reformated mesh in (split vertices, etc)
  5. //
  6. // Copyright (C) 1998-2000 Microsoft Corporation. All Rights Reserved.
  7. //-----------------------------------------------------------------------------
  8. #ifndef __MESHDATA_H__
  9. #define __MESHDATA_H__
  10.  
  11. // ================================================== CVertexNode
  12. // Node for a data stucture what will help expand an array of vertices
  13. // into a list of vertices each of which may have more than one normal based
  14. // on the smoothing groups that the vertex belongs to.  This new expanded
  15. // list of vertices (with duplicated verts) will be what gets exported out.
  16. struct SVertexData
  17. {
  18.     Point3 vNormal;
  19.     DWORD iPointRep; // index not including duplicated vertices (raw vertex index)
  20.     DWORD iWedgeList; // index to next vertex in a list of vertices 
  21.  
  22.     DWORD iTextureIndex;
  23.     DWORD iSmoothingGroupIndex;
  24. };
  25.  
  26. // ================================================== CFaceData
  27. struct SFaceData
  28. {
  29.     DWORD index[3];
  30. };
  31.  
  32. struct SMeshData
  33. {
  34.     SMeshData()
  35.         :m_rgVertices(NULL), m_rgFaces(NULL) {}
  36.  
  37.     ~SMeshData()
  38.     {
  39.         delete []m_rgVertices;
  40.         delete []m_rgFaces;
  41.     }
  42.  
  43.     BOOL m_bTexCoordsPresent;
  44.     DWORD m_cFaces;
  45.     DWORD m_cVertices;
  46.     DWORD m_cVerticesBeforeDuplication;
  47.  
  48.     SVertexData *m_rgVertices;
  49.     SFaceData *m_rgFaces;
  50.  
  51. };
  52.  
  53. HRESULT GenerateMeshData
  54.     (
  55.     Mesh *pMesh,
  56.     SMeshData *pMeshData 
  57.     );
  58.  
  59. struct SPatchVertexData
  60. {
  61.     Point3 vPosition;
  62.     DWORD iPointRep; // index not including duplicated vertices (raw vertex index)
  63.     DWORD iWedgeList; // index to next vertex in a list of vertices 
  64.  
  65.     DWORD iTextureIndex;
  66. };
  67.  
  68. struct SPatchData
  69. {
  70.     DWORD m_cControl;
  71.     DWORD m_rgdwControl[16];
  72. };
  73.  
  74. struct SPatchMeshData
  75. {
  76.     SPatchMeshData()
  77.         :m_rgVertices(NULL), m_rgPatches(NULL) {}
  78.  
  79.     ~SPatchMeshData()
  80.     {
  81.         delete []m_rgVertices;
  82.         delete []m_rgPatches;
  83.     }
  84.  
  85.     BOOL m_bTexCoordsPresent;
  86.     DWORD m_cPatches;
  87.     DWORD m_cVertices;
  88.     DWORD m_cVerticesBeforeDuplication;
  89.  
  90.     SPatchVertexData *m_rgVertices;
  91.     SPatchData *m_rgPatches;
  92. };
  93.  
  94. HRESULT GeneratePatchMeshData
  95.     (
  96.     PatchMesh *pPatchMesh,
  97.     SPatchMeshData *pPatchMeshData 
  98.     );
  99.  
  100. #endif // __MESHDATA_H__